package com.file.other;

import com.bean.TestSpringBoot;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * SpringBoot 读取配置文件测试
 *
 * @author: cxt
 * @time: 2022/2/14
 */
@Controller
@RequestMapping("/read")
@RequiredArgsConstructor // 实现属性自动注入
public class ReadConfig {

    // 不需要@Autowired就可以实现自动注入
    private final TestSpringBoot testSpringBoot;

    @GetMapping("/test")
    @ResponseBody
    public TestSpringBoot test() {
        return testSpringBoot;
    }
}
